import { createI18n } from 'vue-i18n';
// import VueI18n from 'vue-i18n';

const DEFAULT_LANG = 'zh';
const LOCALE_KEY = 'localeLanguage';
const locales = {
    zh: require('./zh.json'),
    en: require('./en.json'),
};
const i18n = createI18n({
    legacy: false,//修复Uncaught SyntaxError: Not available in legacy mode
    locale: window.localStorage.getItem('language') || DEFAULT_LANG, // set locale
    messages: locales,
});

export {i18n};